package com.googlecode.ipinfodb.client;

/**
 * @author Denis Migol
 * 
 */
public class ParamsBuilder {

	public static final String FORMAT_RAW = "raw";
	public static final String FORMAT_XML = "xml";
	public static final String FORMAT_JSON = "json";

	private String key;
	private String ip;
	private String format;

	public ParamsBuilder setKey(final String key) {
		this.key = key;
		return this;
	}

	public ParamsBuilder setIp(final String ip) {
		this.ip = ip;
		return this;
	}

	public ParamsBuilder setFormat(final String format) {
		this.format = format;
		return this;
	}

	public String build() {
		final StringBuilder ret = new StringBuilder();
		ret.append("key=" + key);
		ret.append("&ip=" + ip);
		ret.append("&format" + format);
		return ret.toString();
	}
}
